package graph;

/**
 * Node representing an assignment operation ('='). This node has two attributes: 
 * a reference to a Node representing the variable, and an another to a Node representing
 * the value to be assigned.
 * 
 * @author Habib
 *
 */

public class AssignNode extends Node
{
	/**
	 * A reference to a Node representing the variable
	 */
	public VariableNode variableNode;
	/**
	 * A reference to a Node representing the value to be assigned
	 */
	public ValueNode valueNode;
	
	/**
	 * Create a Node with no reference to either the variable or the value.
	 */
	public AssignNode()
	{
		variableNode = null;
		valueNode = null;
	}
	
	/**
	 * Sets the Node representing the variable
	 * 
	 * @param node
	 */
	public void setVariableNode(VariableNode node)
	{
		variableNode = node;
	}
	
	/**
	 * Sets the Node representing the value
	 * @param node
	 */
	public void setValueNode(ValueNode node)
	{
		valueNode = node;
	}
	
	/**
	 * returns the Node representing the variable
	 * 
	 * @return
	 */
	public VariableNode getVariableNode()
	{
		return variableNode;
	}
	
	/**
	 * returns the Node representing the value
	 * 
	 * @return
	 */
	public ValueNode getValueNode()
	{
		return valueNode;
	}
	
	public String toString()
	{
		return "=";
	}
}